#include <algorithm>
#include <cctype>
#include <set>
#include <string>
#include <vector>
#include <utility>

#include "coefficient.h"

using namespace std;

/** This class is used to parse input equations into linear systems.
 */

class Parser {
 public:
  /** Simple constructor. */
  Parser() : equation_("") {}

  /** equation setter.
   *  @param equation the string containing the equation to parse.
   */
  void set_equation(string equation) { equation_ = equation; }
  /** equation getter.
   *  @return the value of the equation the object holds.
   */
  string equation() { return equation_; }

  /** Get value of the result of the equation.
   *  @return a Coefficient of the right side of the equation.
   */
  Coefficient GetResult();
  /** Get variables with its respective coefficients.
   *  @return a vector with the pairs <variable_name, Coefficient>. 
   */
  vector<pair<string, Coefficient> > GetLeftCoefficients();
 private:
  string equation_; 
};

